import { createSlice } from "@reduxjs/toolkit";

export const userSlice = createSlice({
  name: "user",
  initialState: {
    userInfo: {}, // 用户信息
  },
  reducers: {
    setUser: (state, { payload }) => {
      state.userInfo = payload.user_info || {};
    },
  },
});

export const { setSysSetting, setUser } = userSlice.actions;

export const user = (state) => state.user;

export default userSlice.reducer;
